import Vue from 'vue'
import app from './App.vue'
//按需导入Header mint-ui
import { Header, Swipe, SwipeItem,Button  } from 'mint-ui';
Vue.component(Header.name, Header);
Vue.component(Swipe.name, Swipe);
Vue.component(SwipeItem.name, SwipeItem);
Vue.component(Button.name, Button);

//导入mui样式
import './lib/mui/css/mui.min.css'
//导入依赖的.ttf文件
import './lib/mui/fonts/mui-icons-extra.ttf'
//引入icon需要的css文件
import './lib/mui/css/icons-extra.css'

//导入vue-resource
import VueResource from 'vue-resource'
//安装
Vue.use(VueResource)
// 导入路由
import VueRouter from 'vue-router'
//安装路由
Vue.use(VueRouter)
// 设置全局请求配置
Vue.http.options.root = 'http://vue.studyit.io';

//设置post请求格式emulate application/x-www-form-urlencoded
Vue.http.options.emulateHTTP = true;
import moment from 'moment'
Vue.filter('dataFormat',function(dataStr,param="YYYY-MM-DD HH:mm:ss"){
   return moment(dataStr).formate(param)

})

//导入路由组件
import router from './router.js'
var vm= new Vue({
  el:'#app',
  render: c=>c(app),
  router
})